home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 2000 April / MACPOWER-2000-04.ISO.7z / MACPOWER-2000-04.ISO / ODNスターターキット / Microsoft Internet 4.5 / インターネット接続ウィザード4.5 / Internet Setup / Modem Scripts / US Robotics Universal / US Robotics Universal next >
Text File  |  1999-05-24  |  9KB  |  505 lines

  1. !  USRobotics Universal
  2. !   CUSTOM SCRIPT due to "NO DIAL TONE" responce
  3. !    Author:    Kris Kreutzman
  4. !
  5. !    Copyright:    ゥ 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  6. !
  7. !    revision history:
  8. !        v2.1    as shipped with the ARA 2.1
  9. !       v2.2    update CARRIER/CONNECT parsing
  10. !
  11. !  'mlts' resource info for this modem:
  12. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  13. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  14. !    byte 3 == 33 -> max number of chars in varstr 7
  15. !    byte 4 == 33 -> max number of chars in varstr 8
  16. !    byte 5 == 33 -> max number of chars in varstr 9
  17. !    
  18. @ORIGINATE
  19. @ANSWER
  20. !
  21. ! ---- Initial modem setup ----
  22. !
  23. ! Set serial port speed depending upon the compression flag
  24. !    A higher rate with compression on to handle expanded data from the modem
  25. !    A lower rate closer to the DCE when compression is off
  26. ifstr 5 1 "0"
  27. serreset 57600, 0, 8, 1
  28. jump 2
  29. !
  30. @LABEL 1
  31. serreset 38400, 0, 8, 1
  32. !
  33. @LABEL 2
  34. hsreset 0 0 0 0 0 0
  35. settries 0
  36. !
  37. ! Get the modem's attention
  38. !
  39. matchclr
  40. matchstr 1 3 "OK¥13¥10"
  41. write "AT¥13"
  42. matchread 30
  43. !
  44. @LABEL 3
  45. !
  46. ! Setup the modem for the following:
  47. !   Reset to factory settings
  48. !   Standard compression/reliablity
  49. !   Lock serial port speed
  50. !   Serial port hardware handshaking, turn off software handshaking
  51. !   Verbose responces and compression/protocol results
  52. !   CONNECT returns DCE speed
  53. !   Turn off answering
  54. !   Reset or return to command mode on DTR toggle (optional)
  55. !
  56. pause 5
  57. matchclr
  58. matchstr 1 4   "OK¥13¥10"
  59. matchstr 2 101 "ERROR¥13¥10"
  60. write "AT&FE0&D2&H1&R1&B1Q0X4&A3S7=75S0=0¥13"
  61. matchread 30
  62. inctries
  63. iftries 3 101
  64. !
  65. ! Reset the Modem on setup failure
  66. !
  67. DTRClear
  68. pause 5
  69. DTRSet
  70. flush
  71. jump 3
  72. !
  73. !
  74. @LABEL 4
  75. ! Varstring 4 , reliable link protocol:
  76. !    = 0, handled by computer (ARAP)
  77. !    = 1, handled by modem (PPP)
  78. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  79. ifstr 4 5 "1"
  80. ifstr 4 5 "2"
  81. !
  82. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  83. matchclr
  84. matchstr 1 9 "OK¥13¥10"
  85. write "AT&M0¥13"
  86. matchread 30
  87. jump 101
  88. !
  89. !
  90. @LABEL 5
  91. ! Varstring 5, compression protocol:
  92. !    = 0, handled by computer 
  93. !    = 1, handled by modem
  94. ifstr 5 9 "1"
  95. !
  96. ! Varstring 5 == 0, turn off compression protocol in modem.
  97. matchclr
  98. matchstr 1 9 "OK¥13¥10"
  99. write "AT&K0¥13"
  100. matchread 30
  101. jump 101
  102. !
  103. !
  104. @LABEL 9
  105. ! Varstring 2, modem speaker:
  106. !    = 0, speaker off
  107. !    = 1, speaker on
  108. ifstr 2 13 "1"
  109. pause 5
  110. matchclr
  111. matchstr 1 13 "OK¥13¥10"
  112. write "ATM0¥13"
  113. matchread 30
  114. jump 101
  115. !
  116. ! Modem ready, wait for a call or originate a call
  117. !
  118. @LABEL 13
  119. ifANSWER 32
  120. !
  121. !
  122. ! ---- Originating a call ----
  123. !
  124. ! Varstring 6, dialing mode:
  125. !    = 0, normal dialing
  126. !    = 1, blind dialing
  127. !    = 2, manual dialing
  128. ifstr 6 17 "1"
  129. ifstr 6 15 "2"
  130. jump 19
  131. !
  132. @LABEL 15
  133. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  134. ASK 2 "Pick up the phone & dial ^1.  When the phone rings, click OK then hang up." 107
  135. note "Manual dialing initiated" 3
  136. ! X1 to ignore dialtone & busy, D to dial, ¥^ generates data tone
  137. write "ATX1D¥^¥13"
  138. jump 32
  139. !
  140. @LABEL 17
  141. note "Dialing without tone" 3
  142. matchclr
  143. matchstr 1 19 "OK¥13¥10"
  144. ! X1 to ignore dialtone & busy
  145. write "ATX1¥13"
  146. matchread 30
  147. jump 101
  148. !
  149. !
  150. @LABEL 19
  151. ! Display the full dialstring contained in Varstring 1
  152. note "Dialing ^1" 3
  153. !
  154. ! Varstrings 7, 8 and 9, contain dialstring fragments
  155. !    Long phone numbers may need to be split into smaller groups
  156. !    for the modem to use
  157. !
  158. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  159. ! Varstring 8 == blank (dialstring in varstring 7)
  160. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  161. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  162. ! ¥^ is added to the dialstring to force the modem to generate a data tone
  163. ifstr 8 27 " "
  164. ifstr 9 24 " "
  165. !
  166. !  Write dialstring in varstrings 7, 8 & 9
  167. matchclr
  168. matchstr 1 21 "OK¥13¥10"
  169. write "ATD^3^7;¥13"
  170. matchread 400
  171. jump 101
  172.  
  173. @LABEL 21
  174. matchclr
  175. matchstr 1 22 "OK¥13¥10"
  176. write "ATD^3^8;¥13"
  177. matchread 400
  178. jump 101
  179.  
  180. @LABEL 22
  181. write "ATD^3^9¥13"
  182. jump 32
  183. !
  184. !
  185. @LABEL 24
  186. !  Write dialstring in varstrings 7 & 8
  187. matchclr
  188. matchstr 1 25 "OK¥13¥10"
  189. write "ATD^3^7;¥13"
  190. matchread 400
  191. jump 101
  192.  
  193. @LABEL 25
  194. write "ATD^3^8¥13"
  195. jump 32
  196. !
  197. @LABEL 27
  198. !  Write dialstring in varstring 7
  199. write "ATD^3^7¥13"
  200. !
  201. !
  202. !    ---- Connection responce ----
  203. !
  204. ! The following section will parse modem responces of two types:
  205. !   1) CARRIER xxx, PROTOCOL: yyy, COMPRESSION: yyy, CONNECT xxx
  206. !   2) CONNECT xxx/yyy
  207. !
  208. @LABEL 32
  209. settries 0
  210. @LABEL 33
  211. matchclr
  212. matchstr  1 81  "RING¥13¥10"
  213. matchstr  2 102 "NO DIAL TONE¥13¥10"
  214. matchstr  3 103 "NO CARRIER"
  215. matchstr  4 103 "ERROR¥13¥10"
  216. matchstr  5 104 "BUSY¥13¥10"
  217. matchstr  6 105 "NO ANSWER¥13¥10"
  218. matchstr  7 35  "CONNECT"
  219. matchstr  8 34  "CARRIER"
  220. matchstr  9 62  "PROTOCOL: LAP"
  221. matchstr 10 62  "PROTOCOL: MNP"
  222. matchstr 11 62  "PROTOCOL: ALT"
  223. matchstr 12 67  "COMPRESSION: V"
  224. matchstr 13 67  "COMPRESSION: MNP5"
  225. matchstr 14 67  "COMPRESSION: CLASS"
  226. matchread 700
  227. ifANSWER 32
  228. jump 105
  229. !
  230. !  CARRIER parsing
  231. !
  232. @LABEL 34
  233. jsr 38
  234. inctries
  235. jump 33
  236. !
  237. !  CONNECT parsing - do not parse rate if CARRIER seen
  238. !
  239. @LABEL 35
  240. iftries 1 61
  241. jsr 38
  242. jump 61
  243. !
  244. !  Parse CONNECT/CARRIER rate subroutine
  245. !    2400 and 4800 have two entries each
  246. !    to distinguish them from 24000 and 48000
  247. !
  248. @LABEL 38
  249. matchclr
  250. matchstr  1 40 "2400¥13"
  251. matchstr  2 40 "2400/"
  252. matchstr  3 41 "4800¥13"
  253. matchstr  4 41 "4800/"
  254. matchstr  5 42 "7200"
  255. matchstr  6 43 "9600"
  256. matchstr  7 44 "12000"
  257. matchstr  8 45 "14400"
  258. matchstr  9 46 "16800"
  259. matchstr 10 47 "19200"
  260. matchstr 11 48 "21600"
  261. matchstr 12 49 "24000"
  262. matchstr 13 50 "26400"
  263. matchstr 14 51 "28800"
  264. matchstr 15 52 "31200"
  265. matchstr 16 53 "33600"
  266. matchread 10
  267. jump 59
  268. !
  269. ! -- Connection rates --
  270. ! CommunicatingAt informs ARA of the raw modem to modem
  271. ! connection speed.
  272. !
  273. @LABEL 40
  274. note "Communicating at 2400 bps." 2
  275. CommunicatingAt 2400
  276. jump 60
  277. !
  278. @LABEL 41
  279. note "Communicating at 4800 bps." 2
  280. CommunicatingAt 4800
  281. jump 60
  282. !
  283. @LABEL 42
  284. note "Communicating at 7200 bps." 2
  285. CommunicatingAt 7200
  286. jump 60
  287. !
  288. @LABEL 43
  289. note "Communicating at 9600 bps." 2
  290. CommunicatingAt 9600
  291. jump 60
  292. !
  293. @LABEL 44
  294. note "Communicating at 12400 bps." 2
  295. CommunicatingAt 12400
  296. jump 60
  297. !
  298. @LABEL 45
  299. note "Communicating at 14400 bps." 2
  300. CommunicatingAt 14400
  301. jump 60
  302. !
  303. @LABEL 46
  304. note "Communicating at 16800 bps." 2
  305. CommunicatingAt 16800
  306. jump 60
  307. !
  308. @LABEL 47
  309. note "Communicating at 19200 bps." 2
  310. CommunicatingAt 19200
  311. jump 60
  312. !
  313. @LABEL 48
  314. note "Communicating at 21600 bps." 2
  315. CommunicatingAt 21600
  316. jump 60
  317. !
  318. @LABEL 49
  319. note "Communicating at 24000 bps." 2
  320. CommunicatingAt 24000
  321. jump 60
  322. !
  323. @LABEL 50
  324. note "Communicating at 26400 bps." 2
  325. CommunicatingAt 26400
  326. jump 60
  327. !
  328. @LABEL 51
  329. note "Communicating at 28800 bps." 2
  330. CommunicatingAt 28800
  331. jump 60
  332. !
  333. @LABEL 52
  334. note "Communicating at 31200 bps." 2
  335. CommunicatingAt 31200
  336. jump 60
  337. !
  338. @LABEL 53
  339. note "Communicating at 33600 bps." 2
  340. CommunicatingAt 33600
  341. jump 60
  342. !
  343. @LABEL 59
  344. note "Communicating at an unknown rate." 2
  345. !
  346. @LABEL 60
  347. return
  348. !
  349. ! Look for reliablilty and compression results 
  350. ! after the CONNECT rate.
  351. !
  352. @LABEL 61
  353. matchclr
  354. matchstr  1 63 "LAPM"
  355. matchstr  2 63 "REL"
  356. matchstr  3 63 "ARQ"
  357. matchstr  4 68 "COMP/"
  358. matchstr  5 68 "COMP¥13"
  359. matchstr  6 63 "V42/"
  360. matchstr  7 63 "V42¥13"
  361. matchstr  8 68 "V42BIS"
  362. matchstr  9 68 "V42bis"
  363. matchstr 10 63 "MNP¥13"
  364. matchstr 11 68 "MNP5"
  365. matchstr 12 70 "¥10"
  366. matchread 10
  367. jump 70
  368.  
  369. ! -- Modem error correction link negotiation --
  370. ! Userhook 2 informs ARA that a modem-to-modem error
  371. ! correcting protocol has been negotiated
  372. !
  373. !
  374. @LABEL 62
  375. note "Modem Reliable Link Established." 2
  376. userhook 2
  377. jump 33
  378. !
  379. @LABEL 63
  380. note "Modem Reliable Link Established." 2
  381. userhook 2
  382. jump 61
  383. !
  384. ! -- Compression negotiation --
  385. ! Userhook 3 informs ARA that a modem-to-modem compression
  386. ! protocol has been negotiated
  387. !
  388. @LABEL 67
  389. note "Modem Compression Established." 2
  390. userhook 3
  391. jump 33
  392. !
  393. @LABEL 68
  394. note "Modem Compression Established." 2
  395. userhook 3
  396. jump 61
  397. !
  398. !
  399. ! -- Normal exit after "CONNECT" --
  400. !
  401. !  This modem has been setup to do CTS handshaking,
  402. !  and we assume that a CTS handshaking cable is being used.
  403. !
  404. @LABEL 70
  405. ! Turn on CTS handshaking.
  406. HSReset 0 1 0 0 0 0
  407. !
  408. ifANSWER 71
  409. pause 30
  410. @LABEL 71
  411. exit 0
  412. !
  413. !
  414. ! ---- Answer calls ----
  415. !
  416. !    A RING result from the modem and in ANSWERING mode
  417. !    claims the serial port and answering the phone
  418. !
  419. @LABEL 81
  420. ifORIGINATE 32
  421. userhook 1
  422. note "Answering phone..." 2
  423. write "ATA¥13"
  424. jump 32
  425. !
  426. !
  427. ! ---- Hang up and reset modem ----
  428. !
  429. @HANGUP
  430. @LABEL 90
  431. settries 0
  432. HSReset 0 0 0 0 0 0
  433. !
  434. @LABEL 92
  435. !  Escape from data to command mode
  436. matchclr
  437. matchstr 1 96 "OK¥13¥10"
  438. write "+++"
  439. matchread 20
  440. !
  441. @LABEL 94
  442. ! Force a hangup
  443. matchclr
  444. matchstr 1 98 "NO CARRIER¥13¥10"
  445. matchstr 2 98 "OK¥13¥10"
  446. matchstr 3 98 "ERROR¥13¥10"
  447. matchstr 4 98 "0¥13¥10"
  448. write "ATH¥13"
  449. matchread 30
  450. ! Try to get control of the modem by toggling DTR
  451. DTRClear
  452. pause 5
  453. DTRSet
  454. flush
  455. !
  456. ! Try the hangup sequence three times otherwise declare and error
  457. inctries
  458. iftries 3 101
  459. jump 92
  460. !
  461. @LABEL 96
  462. ! Pause between data and command mode
  463. pause 50
  464. jump 94
  465. !
  466. !
  467. @LABEL 98
  468. ! Recall the factory settings
  469. pause 15
  470. matchclr
  471. matchstr 1 99 "OK¥13¥10"
  472. write "AT&F¥13"
  473. matchread 30
  474. jump 101
  475. !
  476. @LABEL 99
  477. exit 0
  478. !
  479. ! ---- Error messages -----
  480. !
  481. ! Modem Not Responding
  482. @LABEL 101
  483. exit -6019
  484. !
  485. ! No Dial Tone
  486. @LABEL 102
  487. exit -6020
  488. !
  489. ! No Carrier or Error
  490. @LABEL 103
  491. exit -6021
  492. !
  493. ! Busy
  494. @LABEL 104
  495. exit -6022
  496. !
  497. ! No Answer
  498. @LABEL 105
  499. exit -6023
  500. !
  501. ! User Cancellation
  502. @LABEL 107
  503. exit -6008